package com.bt7274.enums;

/**
 * 考核指标类型
 */
public enum AssessmentMetricType {
    SHARE_RATIO("分享率", "ratio"),
    SEEDING_TIME("做种时间", "seeding_time_hours"),
    UPLOAD_AMOUNT("上传量", "upload_gb"),
    DOWNLOAD_AMOUNT("下载量", "download_gb"),
    ACTIVE_SEEDS("活跃做种数", "active_seeds"),
    BT_COINS("BT币余额", "bt_coins"),
    ONLINE_TIME("在线时长", "online_hours"),
    FORUM_POSTS("论坛发帖数", "forum_posts"),
    REGISTRATION_DAYS("注册天数", "registration_days");

    private final String description;
    private final String metricKey;

    AssessmentMetricType(String description, String metricKey) {
        this.description = description;
        this.metricKey = metricKey;
    }

    public String getDescription() {
        return description;
    }

    public String getMetricKey() {
        return metricKey;
    }

    public static AssessmentMetricType getByMetricKey(String metricKey) {
        for (AssessmentMetricType type : values()) {
            if (type.metricKey.equals(metricKey)) {
                return type;
            }
        }
        return null;
    }
}

